package com.eastjet.maintenance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 设备档案
 *
 * @TableName equipment
 */
@TableName(value = "equipment")
@Data
public class Equipment implements Serializable {


    /**
     * 设备编号
     */
    @TableId(type = IdType.AUTO)
    private Integer eid;

    /**
     * 设备编号
     */
    private String code;

    /**
     * 设备名称
     */
    private String name;

    /**
     * 设备型号
     */
    private String deviceType;

    /**
     * 规格型号
     */
    private String specifications;

    /**
     * 制造国别
     */
    private String manufacture;

    /**
     * 生产厂商
     */
    private String manufacturer;

    /**
     * 出厂编号
     */
    private String factoryNumber;

    /**
     * 品牌
     */
    private String brand;

    /**
     * 出厂日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date dateofManufacture;

    /**
     * 总能率(kw)
     */
    private BigDecimal totalPower;

    /**
     * 体重(吨)
     */
    private BigDecimal weight;

    /**
     * 设备用途
     */
    private String equipmentUse;

    /**
     * 存放位置
     */
    private String storageLocation;

    /**
     * 1.正常,2.禁用,3.报废
     */
    private Integer currentStatus;

    /**
     * 使用部门
     */
    private String useDepartments;

    /**
     * 设备负责人
     */
    private String theEquipment;

    /**
     * 联系方式
     */
    private String contact;

    /**
     * 原值
     */
    private String originalValue;

    /**
     * 启动日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date dateofEnablement;

    /**
     * 安装地点
     */
    private String installationSite;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date creationTime;

    /**
     * 更新人
     */
    private String updater;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updated;

    /**
     * 逻辑删除
     */
    private Integer is_delete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Equipment other = (Equipment) that;
        return (this.getEid() == null ? other.getEid() == null : this.getEid().equals(other.getEid()))
                && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getDeviceType() == null ? other.getDeviceType() == null : this.getDeviceType().equals(other.getDeviceType()))
                && (this.getSpecifications() == null ? other.getSpecifications() == null : this.getSpecifications().equals(other.getSpecifications()))
                && (this.getManufacture() == null ? other.getManufacture() == null : this.getManufacture().equals(other.getManufacture()))
                && (this.getManufacturer() == null ? other.getManufacturer() == null : this.getManufacturer().equals(other.getManufacturer()))
                && (this.getFactoryNumber() == null ? other.getFactoryNumber() == null : this.getFactoryNumber().equals(other.getFactoryNumber()))
                && (this.getBrand() == null ? other.getBrand() == null : this.getBrand().equals(other.getBrand()))
                && (this.getDateofManufacture() == null ? other.getDateofManufacture() == null : this.getDateofManufacture().equals(other.getDateofManufacture()))
                && (this.getTotalPower() == null ? other.getTotalPower() == null : this.getTotalPower().equals(other.getTotalPower()))
                && (this.getWeight() == null ? other.getWeight() == null : this.getWeight().equals(other.getWeight()))
                && (this.getEquipmentUse() == null ? other.getEquipmentUse() == null : this.getEquipmentUse().equals(other.getEquipmentUse()))
                && (this.getStorageLocation() == null ? other.getStorageLocation() == null : this.getStorageLocation().equals(other.getStorageLocation()))
                && (this.getCurrentStatus() == null ? other.getCurrentStatus() == null : this.getCurrentStatus().equals(other.getCurrentStatus()))
                && (this.getUseDepartments() == null ? other.getUseDepartments() == null : this.getUseDepartments().equals(other.getUseDepartments()))
                && (this.getTheEquipment() == null ? other.getTheEquipment() == null : this.getTheEquipment().equals(other.getTheEquipment()))
                && (this.getContact() == null ? other.getContact() == null : this.getContact().equals(other.getContact()))
                && (this.getOriginalValue() == null ? other.getOriginalValue() == null : this.getOriginalValue().equals(other.getOriginalValue()))
                && (this.getDateofEnablement() == null ? other.getDateofEnablement() == null : this.getDateofEnablement().equals(other.getDateofEnablement()))
                && (this.getInstallationSite() == null ? other.getInstallationSite() == null : this.getInstallationSite().equals(other.getInstallationSite()))
                && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
                && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
                && (this.getCreationTime() == null ? other.getCreationTime() == null : this.getCreationTime().equals(other.getCreationTime()))
                && (this.getUpdater() == null ? other.getUpdater() == null : this.getUpdater().equals(other.getUpdater()))
                && (this.getUpdated() == null ? other.getUpdated() == null : this.getUpdated().equals(other.getUpdated()))
                && (this.getIs_delete() == null ? other.getIs_delete() == null : this.getIs_delete().equals(other.getIs_delete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getEid() == null) ? 0 : getEid().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getDeviceType() == null) ? 0 : getDeviceType().hashCode());
        result = prime * result + ((getSpecifications() == null) ? 0 : getSpecifications().hashCode());
        result = prime * result + ((getManufacture() == null) ? 0 : getManufacture().hashCode());
        result = prime * result + ((getManufacturer() == null) ? 0 : getManufacturer().hashCode());
        result = prime * result + ((getFactoryNumber() == null) ? 0 : getFactoryNumber().hashCode());
        result = prime * result + ((getBrand() == null) ? 0 : getBrand().hashCode());
        result = prime * result + ((getDateofManufacture() == null) ? 0 : getDateofManufacture().hashCode());
        result = prime * result + ((getTotalPower() == null) ? 0 : getTotalPower().hashCode());
        result = prime * result + ((getWeight() == null) ? 0 : getWeight().hashCode());
        result = prime * result + ((getEquipmentUse() == null) ? 0 : getEquipmentUse().hashCode());
        result = prime * result + ((getStorageLocation() == null) ? 0 : getStorageLocation().hashCode());
        result = prime * result + ((getCurrentStatus() == null) ? 0 : getCurrentStatus().hashCode());
        result = prime * result + ((getUseDepartments() == null) ? 0 : getUseDepartments().hashCode());
        result = prime * result + ((getTheEquipment() == null) ? 0 : getTheEquipment().hashCode());
        result = prime * result + ((getContact() == null) ? 0 : getContact().hashCode());
        result = prime * result + ((getOriginalValue() == null) ? 0 : getOriginalValue().hashCode());
        result = prime * result + ((getDateofEnablement() == null) ? 0 : getDateofEnablement().hashCode());
        result = prime * result + ((getInstallationSite() == null) ? 0 : getInstallationSite().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
        result = prime * result + ((getUpdater() == null) ? 0 : getUpdater().hashCode());
        result = prime * result + ((getUpdated() == null) ? 0 : getUpdated().hashCode());
        result = prime * result + ((getIs_delete() == null) ? 0 : getIs_delete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", eid=").append(eid);
        sb.append(", code=").append(code);
        sb.append(", name=").append(name);
        sb.append(", deviceType=").append(deviceType);
        sb.append(", specifications=").append(specifications);
        sb.append(", manufacture=").append(manufacture);
        sb.append(", manufacturer=").append(manufacturer);
        sb.append(", factoryNumber=").append(factoryNumber);
        sb.append(", brand=").append(brand);
        sb.append(", dateofManufacture=").append(dateofManufacture);
        sb.append(", totalPower=").append(totalPower);
        sb.append(", weight=").append(weight);
        sb.append(", equipmentUse=").append(equipmentUse);
        sb.append(", storageLocation=").append(storageLocation);
        sb.append(", currentStatus=").append(currentStatus);
        sb.append(", useDepartments=").append(useDepartments);
        sb.append(", theEquipment=").append(theEquipment);
        sb.append(", contact=").append(contact);
        sb.append(", originalValue=").append(originalValue);
        sb.append(", dateofEnablement=").append(dateofEnablement);
        sb.append(", installationSite=").append(installationSite);
        sb.append(", remark=").append(remark);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", creationTime=").append(creationTime);
        sb.append(", updater=").append(updater);
        sb.append(", updated=").append(updated);
        sb.append(", tombstone=").append(is_delete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}